package com.snakerflow.framework.flow.assignmentHandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.snaker.engine.Assignment;
import org.snaker.engine.core.Execution;
import org.snaker.engine.model.TaskModel;

import com.snakerflow.framework.security.shiro.ShiroUtils;

public class YMAssignment extends Assignment {
	private static final Logger log = LoggerFactory.getLogger(YMAssignment.class);
	@Override
	public Object assign(TaskModel model, Execution execution) {
		log.debug("assign before:"+model.getAssignee());
		
		String assign = ShiroUtils.getParentPosCode();
		if(assign == null || "".equals(assign)){
			assign = ShiroUtils.getPosCode();
		}
		Long orgId = ShiroUtils.getOrgId();
		assign += "_"+orgId;
		return assign;
	}

}
